/*
 *
 * Copyright (C) 1999-2012 IFLYTEK Inc.All Rights Reserved.
 *
 * FileName：helloController.java
 *
 * Description：
 *
 * History：
 * Version   Author        Date                  Operation
 * 1.0	     ruihe       2019/8/5 14:23         Create
 *
 */

package com.ruihe.controller;


import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * @author ruihe@iflytek.com
 * @version 1.0
 * @create 2019/8/5 14:23
 * @since 1.0
 */
public class HelloController implements Controller{

    private static final Log logger = LogFactory.getLog(HelloController.class);

    /**
     * handleRequest是Controller接口必须实现的方法
     * @param httpServletRequest
     * @param httpServletResponse
     * @return ModelAndView对象
     * @throws Exception
     */
    public ModelAndView handleRequest(HttpServletRequest httpServletRequest,
                                      HttpServletResponse httpServletResponse) throws Exception {
        logger.info("handleRequest 被调用");
        ModelAndView mv = new ModelAndView();
        mv.addObject("message","luna is born");
        mv.setViewName("/WEB-INF/content/born.jsp");
        return mv;
    }
}
